import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';

import '../router/api_router.dart';

const TextStyle btnts = TextStyle(fontSize: 16);

class ApiDemoPage extends StatelessWidget {
  const ApiDemoPage({super.key});


  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(title: const Text("Api Demo")),
      body: Container(
        width: MediaQuery.of(context).size.width,
        height: double.infinity,
        color: const Color(0xFFEEEEEE),
        padding: const EdgeInsets.symmetric(horizontal: 16.0),
        child: SingleChildScrollView(
          child: Column(
            // 这是让按钮铺满的关键
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: [
              ElevatedButton(
                onPressed: () {
                  context.push(ApiRouters.downloadAndInstall.path);
                },
                child: const Text("下载APK并安装")
              ),
              ElevatedButton(
                onPressed: () {
                  context.push(ApiRouters.snackBarTestPage.path);
                },
                child: const Text("SnackBar Demo")
              ),
              ElevatedButton(
                onPressed: () {
                  context.push(ApiRouters.draggableDemo.path);
                },
                child: const Text("支持拖拽的 Demo")
              ),
              ElevatedButton(
                onPressed: () {
                  context.push(ApiRouters.overlayTest.path);
                },
                child: const Text("自定义蒙层(Overlay)的 Demo")
              ),
              ElevatedButton(
                onPressed: () {
                  context.push(ApiRouters.affixHeaderSliver.path);
                },
                child: const Text("支持表头吸顶的自定义滚动 Demo")
              ),
              ElevatedButton(
                onPressed: () {
                  context.push(ApiRouters.expandableSliver.path);
                },
                child: const Text("支持点击表头展开/折叠子列表 Demo")
              ),
              ElevatedButton(
                onPressed: () {
                  context.push(ApiRouters.adDialog.path);
                },
                child: const Text("广告效果dialog Demo")
              ),
              ElevatedButton(
                onPressed: () {
                  context.push(ApiRouters.paintWidget.path);
                },
                child: const Text("Paint绘制 Demo")
              ),
              ElevatedButton(
                onPressed: () {
                  context.push(ApiRouters.paintWithAnimate.path);
                },
                child: const Text("Paint绘制带动画 Demo")
              ),
              ElevatedButton(
                onPressed: () {
                  context.push(ApiRouters.calendarDateDemo.path);
                },
                child: const Text("日期/日历 Demo")
              ),
            ],
          ),
        ),
      ),
    );
  }
}